﻿<!--
功能：接收一个参数名为“url”的url参数，并加载这个参数指向的页面，加载完成前显示加载提示，加载完成后显示加载的页面
-->
<html>
<head>
    <title>正在加载。。。</title>
    <base target ="_self" />
    <script type="text/javascript">
    //读取url参数的函数
        function getValueOfURLParamter(para) {
            var url = unescape(window.location.href);
            var value = '';
            var args = url.substring(url.indexOf('?') + 1).split('&');
            for (var i = 0; i < args.length; i++) {
                if (args[i].substring(0, args[i].indexOf('=')).toUpperCase() == para.toUpperCase()) {
                    value = args[i].substring(args[i].indexOf('=') + 1);
                    break;
                }
            }
            return value;
        }
        //页面加载后执行
        function onCompelete() {
            loading.style.display = 'none';//隐藏覆盖层
            loadingLabel.style.display = 'none';//隐藏loading提示
            document.title = document.getElementById('PageFrame').contentWindow.document.title; //修改title为被加载页面的title
        }
    </script>

</head>
<body style="margin: 0 0 0 0; overflow: hidden;" onload="onCompelete()">
    <div id="loading" style="filter: alpha(opacity=50); width: 1024px; height: 768px;
        position: absolute; top: 0px; left: 0px; text-align: center; vertical-align: middle;
        background-color: white">
    </div>
    <span id="loadingLabel" style="position: absolute;"><img src="images/Loading1.gif" /></span>
    <iframe id="PageFrame" frameborder="0" width="1000" height="700" src=""></iframe>

    <script type="text/javascript">
    //调整loading提示使其上下左右居中
        var label = document.getElementById("loadingLabel");
        label.style.top = document.body.clientHeight / 2;
        label.style.left = document.body.clientWidth / 2 - label.clientWidth / 2;
   //调整覆盖层宽度高度使其能盖住整个页面
        var ld = document.getElementById("loading");
        ld.style.width = screen.width;
        ld.style.height = screen.height;
        ld.style.lineHeight = screen.height;
        //调整iframe宽度高度使其适应屏幕
        var pf = document.getElementById("PageFrame");
        pf.style.width = screen.width;
        pf.style.height = screen.height;

        var url = getValueOfURLParamter('url'); //要加载的url
        //alert(url);
        if (url != "") {
            document.getElementById("PageFrame").src = url;//加载url
        }
        else {
            alert("请指定参数url。");
        }
    
    </script>

</body>
</html>
